<?php
//被废弃xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

namespace App\Http\Controllers\Company;

use App\Facades\Style;
use App\Http\Controllers\Company\CommonController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class AccountController extends CommonController
{

    public function __construct(){
        $this->user = auth()->guard('company')->user();
    }
    /**
     * 账号设置
     * @param Request $request
     * @return mixed
     */
    public function index(Request $request){
        //DB::enableQueryLog();
        //$sql=DB::getQueryLog();
        //print_r($sql);
        return Style::view('company.accountIndex');
    }

    /**
     * 职位管理
     * @param Request $request
     * @return mixed
     */
    public function message(Request $request){
        //获取面试通知记录
        $joblist = DB::table('company_job as t1')
            ->join('company_basic as t2', 't1.com_id', '=', 't2.id')
            ->select(
                't1.id','t1.updatetime','t1.com_id','t1.job_id',
                't2.company_name','t1.job_title'
            )
            ->where('t1.uid',$this->user->uid)
            ->where(function ($query) {
                //$query->where('t3.job_title', 'like', '%'.$this->keyWord.'%')->orWhere('t2.company_name','like','%'.$this->keyWord.'%');
            })
            ->orderBy('created_at')
            ->paginate(20);
        // dd($favorites);
        //设置状态
        //    $job_status =  ($this->job_status!='') ? $this->job_status : '';
        return Style::view('company.interviewManage',compact('joblist'));
    }
}